import Vue from "vue";
import VueRouter from 'vue-router';
import Home from '../comonpents/Home.vue';
import Detail from '../comonpents/detail.vue';
import Login from '../comonpents/login.vue';
import List from '../comonpents/list.vue';

Vue.use(VueRouter);

export default new VueRouter({
    routes: [{
            //首页
            path: '/home',
            component: Home
        },
        {
            path: '/film/:id',
            name: 'detail',
            component: Detail
        },
        {
            // 登录
            path: '/login',
            component: Login
        },
        {
            // 登录
            path: '/list',
            component: List
        },
        {
            path: '*',
            redirect: '/home'
        }
    ]
})